import Vue from 'vue'
import App from './App.vue'
import router from './router'
import './plugins/element.js'
import api from './api/api'
import store from './store'
import directive from './directive' // 自定义指令
import axios from './plugins/axiosConfig' //引入axios配置文件
import eIconPicker from 'e-icon-picker';
import "e-icon-picker/lib/symbol.js"; //基本彩色图标库
import 'e-icon-picker/lib/index.css'; // 基本样式，包含基本图标
import 'font-awesome/css/font-awesome.min.css'; //font-awesome 图标库
import 'element-ui/lib/theme-chalk/icon.css'; //element-ui 图标库

Vue.use(eIconPicker, {FontAwesome: false, ElementUI: true, eIcon: false, eIconSymbol: false});


//挂载拦截器
Vue.prototype.$axios = axios

//接口地址统一管理
Vue.prototype.API = api.API.api
/**
 * 原型链挂载
 * @type {AxiosStatic}
 */
Vue.prototype.$http = axios
Vue.config.productionTip = false

//解决路径跳转的报错
import VueRouter from 'vue-router'

const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push (location) {
  return originalPush.call(this, location).catch(err => err)
}
Vue.use(directive)

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
